package com.crizzbe.storeManage.Controller;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.crizzbe.storeManage.entity.Buyer;
import com.crizzbe.storeManage.entity.Company;
import com.crizzbe.storeManage.entity.Employee;
import com.crizzbe.storeManage.entity.User;
import com.crizzbe.storeManage.mapper.BuyerMapper;
import com.crizzbe.storeManage.mapper.CompanyMapper;

/**
 * <p>
 * 供应商 前端控制器
 * </p>
 *
 * @author Crizzbe
 * @since 2021-06-22
 */
@RestController
@CrossOrigin
@RequestMapping("/StoreManage/company")
public class CompanyController {
	@Autowired
	private CompanyMapper company;
	@GetMapping("/")
	 List<Company> index() {
		 return company.selectList(null);
	 }
	@PostMapping("/add")
	public void add(@RequestBody Company parm) {
		company.insert(parm);
	}
	@PostMapping("/delete")
	public void deleteData(@RequestBody Company parm) {
		company.deleteById(parm.Id);
	}
@PostMapping("/update")
	
	public void update(@RequestBody Company form) {
	company.insert(form);
	}
}

